# Check ZIM_HOME
if (( ! ${+ZIM_HOME} )); then
  print -P '<%= okay %>ZIM_HOME not set, using the default one.'
  ZIM_HOME=${(e)ZIM_HOME_STR}
elif [[ ${ZIM_HOME} == ${(e)ZIM_HOME_STR} ]]; then
  print -P '<%= okay %>Your ZIM_HOME is the default one.'
else
  ZIM_HOME_STR=$(_replace_home ${ZIM_HOME})
  print -PR "<%= okay %>Your ZIM_HOME is customized to %B${ZIM_HOME_STR}%b"
fi
if [[ -e ${ZIM_HOME} ]]; then
  if [[ -n ${ZIM_HOME}(#qN/^F) ]]; then
    print -P '<%= okay %>ZIM_HOME already exists, but is empty.'
  else
    print -u2 -PR "%F{red}<%= error %>%B${ZIM_HOME}%b already exists. Please set ZIM_HOME to the path where you want to install Zim.%f"
    return 1
  fi
fi
